package com.ruoyi.project.mahjong.mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.ruoyi.project.mahjong.domain.TRecord;
import com.ruoyi.project.mahjong.domain.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 整体流水Mapper接口
 *
 * @author ruoyi
 * @date 2023-10-07
 */
public interface TRecordMapper
{

    /**
     * 查询整体流水
     *
     * @param id 整体流水ID
     * @return 整体流水
     */
    public TRecord selectTRecordById(Long id);

    /**
     * 查询整体流水列表
     *
     * @param tRecord 整体流水
     * @return 整体流水集合
     */
    public List<TRecord> selectTRecordList(TRecord tRecord);

    /**
     * 新增整体流水
     *
     * @param tRecord 整体流水
     * @return 结果
     */
    public int insertTRecord(TRecord tRecord);

    /**
     * 修改整体流水
     *
     * @param tRecord 整体流水
     * @return 结果
     */
    public int updateTRecord(TRecord tRecord);

    /**
     * 删除整体流水
     *
     * @param id 整体流水ID
     * @return 结果
     */
    public int deleteTRecordById(Long id);

    /**
     * 批量删除整体流水
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteTRecordByIds(Long[] ids);

    Integer insertOpenTableTRecordList(@Param("tRecords") List<TRecord> tRecords);

    int updateTRecordByOrderNumber(TRecord record1);

    int selectGiveIntergral(@Param("orderNumber")String orderNumber, @Param("id") Long id);

    Integer updateTOpenTableCostRecord(TRecord record);
    Integer updateOneOverTOpenTableCostRecord(TRecord record);

    /**
     * 改变开桌费用赠送的积分
     * @param id
     * @param intergrals
     * @return
     */
    Integer updateTOpenTableIntergral(@Param("id") Long id, @Param("intergrals")Long intergrals,@Param("orderNumber")String orderNumber,@Param("roomId")Long roomId);

    AllIncomeTypeMoneyVo selectRecordAllIncomeTypeMoney(Long shopId);

    String getXjsr(Long shopId, String startTime, String endTime);

    String getQrsr(Long shopId, String startTime, String endTime);

    String getQtsr(Long shopId, String startTime, String endTime);

    String getQtzc(Long shopId, String startTime, String endTime);

    String getSrze(Long shopId, String startTime, String endTime);

    String getTkze(Long shopId, String startTime, String endTime);

    String getSmsr(Long shopId, String startTime, String endTime);

    List <CategorizeIncomeVo>   selectRoomIncome(@Param("shopId") Long shopId, @Param("startTime")String startTime, @Param("endTime")String endTime ,@Param("id")Long id);

    List <RealTimeDataVo> selectProductCost(@Param("shopId") Long shopId, @Param("startTime")String startTime, @Param("endTime")String endTime);

    List<Map<String,Object>> selectCashCost(@Param("shopId") Long shopId, @Param("startTime")String startTime, @Param("endTime")String endTime);

    List<TableReceiveVo> selecttableReCost(@Param("shopId") Long shopId, @Param("startTime")String startTime, @Param("endTime")String endTime);

    List<MemberRechargeVo> selectMemberIdRecharge(@Param("shopId") Long shopId, @Param("startTime")Date startTime, @Param("endTime")Date endTime ,@Param("phone") String phone);

    List<MemberCostRecordVo> selectCostRecord(@Param("shopId") Long shopId, @Param("startTime")String startTime, @Param("endTime")String endTime ,@Param("id") String id);

    List<RechargeRankingVo> selectMemberRechargeList(@Param("shopId") Long shopId, @Param("startTime")String startTime, @Param("endTime")String endTime);

    List<RechargeRankingVo> selectMemberCostList(Long shopId, String startTime, String endTime);

    Integer updateTOpenTableProductPay(@Param("id") Long id, @Param("orderNumber")String orderNumber,@Param("staffId") Long staffId, @Param("payType") String payType);

    List <RecordIncomeType> selectShiftMoneyInfo(@Param("startTime")String startTime, @Param("endTime") String endTime, @Param("shopId") Long shopId, @Param("jbid")  String  jbid);

    Integer updateTRecordByJbId(TRecord record);


    String selectPaymentMoney(@Param("jbid") String jbid,@Param("startTime")String startTime, @Param("endTime") String endTime,@Param("shopId") Long shopId);

    List<WorkRecordVo> selectWorkRecordList(@Param("startTime")String startTime, @Param("endTime") String endTime,@Param("shopId") Long shopId);

    List <RealTimeDataVo> selectGiveMoney(@Param("shopId") Long shopId,@Param("startTime")String startTime, @Param("endTime") String endTime);

    List<ProductRecordInfoVo> selectReceive(List<Long> ids);

    List<RoomRecordInfoVo> selectRoomReceive(List<Long> ids);

    OpenTableRateVo selectOenTableRate(Long shopId);

    List <RealTimeDataVo> selectRecordCostMoney(@Param("shopId") Long shopId,@Param("startTime")String startTime, @Param("endTime") String endTime);

    Integer addReceive(TRecord record);

    Integer updateDefault(@Param("costId") Long costId,@Param("shopId")Long shopId);

    String selectOtherMoney(@Param("jbid")Long jbid, @Param("startTime")String startTime,@Param("endTime") String endTime,@Param("shopId") Long shopId);

    List<OtherReceiveVo> selectOtherReceive(List<Long> ids);

    String selectRefundMoney(@Param("jbid")Long jbid,  @Param("startTime")String startTime, @Param("endTime")String endTime,@Param("shopId") Long shopId);

    List<TRecord> selectTopUpOrRefundList(@Param("shopId") Long shopId, @Param("type") String type, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("deskId") String deskId, @Param("staffName")String staffName);

    List<Map<String,Object>> selectTableCollectList(@Param("shopId") Long shopId, @Param("startTime")String startTime, @Param("endTime")String endTime);

    String selectIncomeMoney(@Param("jbid")Long jbid, @Param("type")String type);

    List<TRecord> selectDeskMoenyList(@Param("shopId") Long shopId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("deskId") String deskId, @Param("staffName")String staffName);
}
